<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue中条件渲染</title>
</head>
<style>
    .activated {
        color: red;
    }
</style>
<body>
    <div id="app">
        <div v-if="show">
            {{ message }}
        </div>
        <div v-show="show">
            {{message}}
        </div>
        <div v-if="show === 'a'">
            show if 内容
        </div>
        <div v-else-if="show === 'b'">
            show2 elif 内容
        </div>
        <div v-else>
            show3 else 内容
        </div>

        <div v-if="show">
            用户名：<input type="text" key="username" />
        </div>
        <div v-else>
            邮箱：<input type="email" key="email" />
        </div>
    </div>
</body>
<script src="vue.js"></script>
<script>

    var vm = new Vue({
        el: '#app',
        data: {
            show: false,
            message: 'hello world!'
        }
        
    })
</script>
</html>